﻿#ifndef ADTCP_H
#define ADTCP_H

#include <QTcpServer>
#include <QTcpSocket>
#include <QHostAddress>
#include <QMessageBox>
#include <QList>
#include <QListWidget>
#include <QBuffer>
#include <QFileInfo>
#include <QTime>
#include "client.h"
#include "tcp_MSG.h"




class AdTcp : public QTcpServer
{
    Q_OBJECT
public:
     AdTcp(QListWidget *_client_lw, QObject *parent = 0);
     ~AdTcp();
     void broadcastMsg(tcp_MSG msg);// 文字 广播下发
     void MultiSelectUnicastMsg(tcp_MSG msg);// 天气  多选单播下发

     void Ad_SendAction(int action,QString path,int index,int allAd_Num);// 广告发送操作

signals:
     void GUI_WarningSignal(QString title,QString text,QString buttons,QString defaultButton);//设置警报
public slots:
    void newClient();// 新的客户端连接
    void read_back();//读取客户端上传ID
    void rmClient();//删除客户端

private:
    QList<Client *> *client_list;
    QListWidget *client_lw;
    QByteArray  sendImage;
};

#endif // ADTCP_H
